//
// C++ Interface: clocktower
//
// Description: 
//
//
// Author:  <>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef CLOCKTOWER_H
#define CLOCKTOWER_H

#include <qobject.h>
#include <qpair.h>
#include <qdatetime.h>
#include <qtimer.h>

class Snapshot;
class SnapshotManager;
typedef QList<Snapshot*> SnapshotList;
/**
	@author 
*/
class ClockTower : public QObject
{
  Q_OBJECT

public:
    ClockTower(QObject *parent, SnapshotManager *sm);

    ~ClockTower();

    void registerSnapshot(Snapshot *s);
    bool unregisterSnapshot(Snapshot *s);
private:
	QList< QPair<SnapshotList, QDateTime> > m_snapshotlist;
	QTimer *m_timer;
	SnapshotManager *m_snapshotmanager;
	void sortedInsert(Snapshot *s);
	void updateTimer();
protected slots:
	void slotTimeout();
};

#endif
